package com.connector.server.jmx;

import java.util.Date;
import java.text.SimpleDateFormat;
import com.connector.server.util.StringUtils;
import com.connector.base.message.model.ChatMessage;

public class JmxMessageBean
{
    private String msgUID;
    private String userId;
    private String targetId;
    private String text;
    private String textType;
    private String sendType;
    private String deviceId;
    private String dialogId;
    private String date;
    private String must;
    private String photo;
    private String otherText;
    private Long msgId;
    private String fileName;
    private String userName;
    private String htmlText;
    private String onlyMobile;
    private String audioTimeLength;
    private Boolean pcOrApp;
    
    public JmxMessageBean() {
        this.onlyMobile = "0";
    }
    
    public static JmxMessageBean build(final ChatMessage message) {
        final JmxMessageBean jmxMessageBean = new JmxMessageBean();
        jmxMessageBean.setMsgUID(StringUtils.getUUID());
        jmxMessageBean.setDate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
        jmxMessageBean.setDeviceId(message.getDeviceId());
        jmxMessageBean.setTargetId(message.getReceiver());
        jmxMessageBean.setSendType(message.getType());
        jmxMessageBean.setText(message.getBody());
        jmxMessageBean.setTextType(message.getContentType());
        jmxMessageBean.setUserId(message.getUserId());
        jmxMessageBean.setDialogId(message.getDialogId());
        jmxMessageBean.setPhoto(message.getPhoto());
        jmxMessageBean.setOtherText(message.getOtherText());
        jmxMessageBean.setFileName(message.getFileName());
        jmxMessageBean.setUserName(message.getUserName());
        jmxMessageBean.setHtmlText(message.getHtmlText());
        jmxMessageBean.setAudioTimeLength(message.getAudioTimeLength());
        jmxMessageBean.setPcOrApp(message.getPcOrApp());
        return jmxMessageBean;
    }
    
    public void setMsgUID(final String msgUID) {
        this.msgUID = msgUID;
    }
    
    public void setUserId(final String userId) {
        this.userId = userId;
    }
    
    public void setTargetId(final String targetId) {
        this.targetId = targetId;
    }
    
    public void setText(final String text) {
        this.text = text;
    }
    
    public void setTextType(final String textType) {
        this.textType = textType;
    }
    
    public void setSendType(final String sendType) {
        this.sendType = sendType;
    }
    
    public void setDeviceId(final String deviceId) {
        this.deviceId = deviceId;
    }
    
    public void setDialogId(final String dialogId) {
        this.dialogId = dialogId;
    }
    
    public void setDate(final String date) {
        this.date = date;
    }
    
    public void setMust(final String must) {
        this.must = must;
    }
    
    public void setPhoto(final String photo) {
        this.photo = photo;
    }
    
    public void setOtherText(final String otherText) {
        this.otherText = otherText;
    }
    
    public void setMsgId(final Long msgId) {
        this.msgId = msgId;
    }
    
    public void setFileName(final String fileName) {
        this.fileName = fileName;
    }
    
    public void setUserName(final String userName) {
        this.userName = userName;
    }
    
    public void setHtmlText(final String htmlText) {
        this.htmlText = htmlText;
    }
    
    public void setOnlyMobile(final String onlyMobile) {
        this.onlyMobile = onlyMobile;
    }
    
    public void setAudioTimeLength(final String audioTimeLength) {
        this.audioTimeLength = audioTimeLength;
    }
    
    public void setPcOrApp(final Boolean pcOrApp) {
        this.pcOrApp = pcOrApp;
    }
    
    public String getMsgUID() {
        return this.msgUID;
    }
    
    public String getUserId() {
        return this.userId;
    }
    
    public String getTargetId() {
        return this.targetId;
    }
    
    public String getText() {
        return this.text;
    }
    
    public String getTextType() {
        return this.textType;
    }
    
    public String getSendType() {
        return this.sendType;
    }
    
    public String getDeviceId() {
        return this.deviceId;
    }
    
    public String getDialogId() {
        return this.dialogId;
    }
    
    public String getDate() {
        return this.date;
    }
    
    public String getMust() {
        return this.must;
    }
    
    public String getPhoto() {
        return this.photo;
    }
    
    public String getOtherText() {
        return this.otherText;
    }
    
    public Long getMsgId() {
        return this.msgId;
    }
    
    public String getFileName() {
        return this.fileName;
    }
    
    public String getUserName() {
        return this.userName;
    }
    
    public String getHtmlText() {
        return this.htmlText;
    }
    
    public String getOnlyMobile() {
        return this.onlyMobile;
    }
    
    public String getAudioTimeLength() {
        return this.audioTimeLength;
    }
    
    public Boolean getPcOrApp() {
        return this.pcOrApp;
    }
}
